package com.start.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.start.admin.entity.StartSysNoticeBrowseEntity;
import com.start.admin.mappers.SysNoticeBrowseMapper;
import com.start.admin.service.StartSysNoticeBrowseService;
import org.springframework.stereotype.Service;


@Service
public class StartSysNoticeBrowseServiceImpl extends ServiceImpl<SysNoticeBrowseMapper, StartSysNoticeBrowseEntity> implements StartSysNoticeBrowseService {


    @Override
    public StartSysNoticeBrowseEntity getByUserIdAndNoticeId(String userId, String noticeId) {
        LambdaQueryWrapper<StartSysNoticeBrowseEntity> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(StartSysNoticeBrowseEntity::getBrowseUserId, userId);
        queryWrapper.eq(StartSysNoticeBrowseEntity::getNoticeId, noticeId);
        return getOne(queryWrapper, false);
    }
}